Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul Config Management #266

Merged
merged 3 commits into from
Apr 29, 2022
Merged

Overhaul Config Management #266

merged 3 commits into from
Apr 29, 2022

Conversation

Princesseuh
Copy link
Member

@Princesseuh Princesseuh commented Apr 29, 2022

Changes

Configuration in language servers can work in two modes: push and pull. The former is what we're currently doing, where the client will push settings to the server at initialization, this mode is deprecated in favor of the later, pull.

In that mode, the server will pull configurations sections from the client, this does not make people necessarily happy and it is in fact, not as easy as implement and use as the previous mode but it allows for per-workspace and per-document settings, which is nice

So this PR migrates to pull mode, additionally this PR includes a refactor to our settings definitions inside the VS Code's extension package.json to make sure every settings is there with the proper names. Some settings were removed as they're features we don't support yet anyway.

We also now respect the user's TS settings inside their editors. Previously we'd either force the default settings or force our own settings. This allow users to control the result of completions and code actions (for instance, if you have typescript.preferences.quoteStyle set to double, the completion will now always use ").

Some of the default settings are much better than what we forced on, notice how it recommends the aliases paths now, whereas previously it would recommend a relative path:

image

Testing

Tests updated for new config

Docs

The new settings are documented by their title and a short description

@changeset-bot
Copy link

changeset-bot bot commented Apr 29, 2022

⚠️ No Changeset found

Latest commit: a197191

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@Princesseuh Princesseuh self-assigned this Apr 29, 2022
@Princesseuh Princesseuh changed the title [WIP] Overhaul Config Management Overhaul Config Management Apr 29, 2022
@Princesseuh Princesseuh marked this pull request as ready for review April 29, 2022 17:47
@Princesseuh Princesseuh requested a review from a team as a code owner April 29, 2022 17:47
@aFuzzyBear
Copy link

Nup, no idea, not even the slightest clue.....however it does sound really good!
Week on week, you are crushing it.... 💚💚💚

Copy link
Collaborator

@matthewp matthewp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a very big PR and I didn't understand all of it, but I did understand that we are now actually checking if a feature is enabled or not and I see lots of tests so this gets a lgtm from me!

@@ -42,6 +42,7 @@ export const astroAttributes = newHTMLDataProvider('astro-attributes', {
{
name: 'is:raw',
description: 'Instructs the Astro compiler to treat any children of this element as text',
valueSet: 'v',
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unrelated to the config change, I just noticed that it had the wrong valueSet while testing things. This is very much harmless so figured I'd do it here

@Princesseuh Princesseuh merged commit 33a2028 into main Apr 29, 2022
@Princesseuh Princesseuh deleted the config-overhaul branch April 29, 2022 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants